﻿using System;
using System.Data.Linq.Mapping;
using Moneyman.Infrastructure;

namespace Moneyman.DataModel
{
    [Table(Name = "Cases")]
    public partial class CaseInfo : NotificationObject
    {
        #region Fields
        private string guid = System.Guid.NewGuid().ToString();
        private string title;
        private string place;
        private string description;
        private DateTime startDate = DateTime.Now;
        private double sumOfIncome = 0;
        private double sumOfExpense = 0;
        private int transactionCount = 0;
        #endregion

        #region Properties
        [Column(IsPrimaryKey = true)]
        public string Guid
        {
            get { return guid; }
            set
            {
                guid = value;
                RaisePropertyChanged(() => Guid);
            }
        }

        [Column]
        public string Title
        {
            get { return title; }
            set
            {
                title = value;
                RaisePropertyChanged(() => Title);
            }
        }

        [Column]
        public string Place
        {
            get { return place; }
            set
            {
                place = value;
                RaisePropertyChanged(() => Place);
            }
        }

        [Column]
        public string Description
        {
            get { return description; }
            set
            {
                description = value;
                RaisePropertyChanged(() => Description);
            }
        }

        [Column]
        public DateTime StartDate
        {
            get { return startDate; }
            set
            {
                startDate = value;
                RaisePropertyChanged(() => StartDate);
            }
        }

        public double SumOfIncome
        {
            get { return sumOfIncome; }
            set {
                sumOfIncome = value;
                RaisePropertyChanged(() => SumOfIncome);
            }
        }

        public double SumOfExpense
        {
            get { return sumOfExpense; }
            set
            {
                sumOfExpense = value;
                RaisePropertyChanged(() => SumOfExpense);
            }
        }

        public int TransactionCount
        {
            get { return transactionCount; }
            set
            {
                transactionCount = value;
                RaisePropertyChanged(() => TransactionCount);
            }
        }
        #endregion
    }
}
